package m4d2;

import java.util.function.Function;

//function接口  默认方法andThen用来组合操作
public class landThen {
    public static void change(String s, Function<String,Integer> fun1,Function<Integer,String> fun2){
        //fun1把字符串转换In,fun2再转回来，用andthen组合
        String ss = fun1.andThen(fun2).apply(s);
        System.out.println(ss);
    }

    public static void main(String[] args) {
        String s = "1234";

        change(s,(String str)->{
            return Integer.parseInt(str)+10;
        },(Integer i)->{
            return i+"";
        });
    }
}
